package exception;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 *  当派生类重写超类含有throws声明异常抛出的方法时，对throws的重写规则
 * @date 2023/3/10 11:01
 */
public class ThrowsDemo2 {
    public void dosome() throws IOException, AWTException {

    }
}
class SubCalss extends ThrowsDemo2{
    //public void dosome() throws IOException, AWTException {}
    //public void dosome(){ }
    //public void dosome throws IOException(){ }
    //public void dosome() throws FileNotFoundException { }

    //不能抛的
    //不允许抛出额外异常
   // public void dosome() throws IllegalAgeException{ }
    //不允许抛出超类方法抛出的超类异常
    //public void dosome() throws Exception{ }
}